/* DLC tren — minijuegos: lo común (cortina, rótulo, «Ya está», la barra de franja). Encima del kit (src/mg.css). */
.tmg {
    position: fixed; inset: 0; z-index: 99985; background: #05080c; overflow: hidden;
    touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair;
    animation: tmgIn .35s ease-out backwards;
}

.tmg.is-out { opacity: 0; transition: opacity .35s ease-in; pointer-events: none; }

@keyframes tmgIn { from { opacity: 0; } }

.tmg-gl, .tmg-gl canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.tmg-fx { position: absolute; inset: 0; pointer-events: none; opacity: 0; }

/* rótulo breve en el centro */
.tmg-msg {
    position: absolute; left: 50%; top: 27%; transform: translate(-50%, -50%) scale(.92); opacity: 0;
    font: 700 clamp(18px, 3.2vw, 30px) Cinzel, Georgia, serif; letter-spacing: .04em; color: #fff6e0;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .8), 0 0 2px #000; text-align: center; pointer-events: none; z-index: 7;
    transition: opacity .25s, transform .25s; max-width: 86vw;
}

.tmg-msg.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.tmg-msg.is-bad { color: #ffb4a4; }

.tmg-msg.is-go { color: #ffe28a; font-size: clamp(26px, 5vw, 46px); }

.tmg-msg.is-soft { font: italic 500 clamp(16px, 2.4vw, 22px) Spectral, Georgia, serif; color: #f6e6cc; top: 70%; letter-spacing: 0; }

/* cortina de carga: un billete helado */
.tmg-veil {
    position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(120% 90% at 50% 10%, #1c3550 0%, #0b1726 55%, #050a12 100%);
    transition: opacity .5s ease;
}

.tmg-veil.is-off { opacity: 0; pointer-events: none; }

.tmg-veil-in {
    display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 40px 24px;
    border-radius: 14px; border: 1px dashed rgba(220, 236, 255, .45);
    background: linear-gradient(180deg, rgba(240, 246, 255, .09), rgba(240, 246, 255, .03));
    box-shadow: 0 0 0 6px rgba(220, 236, 255, .05), 0 18px 50px rgba(0, 0, 0, .5);
    color: #eaf2ff; text-align: center;
}

.tmg-veil-icon { font-size: 40px; filter: drop-shadow(0 0 10px rgba(180, 210, 255, .5)); }

.tmg-veil-in b { font: 700 22px Cinzel, Georgia, serif; letter-spacing: .08em; }

.tmg-veil-in em { font: italic 15px Spectral, Georgia, serif; color: #b9c9de; }

.tmg-bar { width: 240px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .12); overflow: hidden; }

.tmg-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #9cc8ff, #fff); transition: width .25s; }

/* el cristal: «Ya está» */
.mg-hud .tmg-done { pointer-events: auto !important; cursor: pointer; padding: 6px 18px; border-radius: 999px;
    background: rgba(4, 15, 22, .7); color: #f3efe6; border: 1px solid rgba(244, 199, 94, .6); font: 600 13px system-ui, sans-serif; }

.mg-hud .tmg-done:hover { border-color: #f4c75e; color: #fff; }

.mg-hud.is-over .tmg-done { display: none; }

@media (prefers-reduced-motion: reduce) { .tmg { animation: none; } .tmg-msg { transition: none; } }

/* barra con franja buena y marca */
.tmg2-band { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; margin: 2px 4px;
    background: rgba(4, 15, 22, .62); border: 1px solid rgba(244, 199, 94, .3); font: 600 13px system-ui, sans-serif; color: #f3efe6; }

.tmg2-band b { position: relative; display: block; width: 200px; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, .12); }

.tmg2-band s { position: absolute; top: 0; bottom: 0; background: rgba(120, 220, 140, .3); border-left: 1px solid rgba(140, 240, 160, .7); border-right: 1px solid rgba(140, 240, 160, .7); }

.tmg2-band i { position: absolute; top: -4px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: #f4c75e; box-shadow: 0 0 8px rgba(244, 199, 94, .8); transition: left .08s linear; }

.tmg2-band.is-ok i { background: #9ff0b0; box-shadow: 0 0 10px rgba(140, 240, 160, .9); }

.tmg2-band.is-bad i { background: #ff7a6a; box-shadow: 0 0 10px rgba(255, 110, 90, .9); }

.tmg2-band.is-bad { border-color: rgba(255, 110, 90, .6); }

.tmg2-band.is-slip s { background: rgba(140, 200, 255, .18); }

/* M1 · ctx.exterior / ctx.place: La Línea detrás (src/train/mg/world.js) y el lienzo del juego, transparente, encima */
.tmg-line { position: absolute; inset: 0; }
.tmg-gl canvas.tmg-over { z-index: 1; }
.tmg .ln-hud, .tmg .ln-fade, .tmg .ln-postal, .tmg .ln-curtain { display: none !important; }
